<div class="view-header">
    <div class="view-header-left" ng-init="new_used_car = false">
        <!-- 添加
        <div class="view-header-item color-open" ng-click="new_used_car = !new_used_car" title="添加库存" ng-show='!new_used_car'>
            <i class="fa fa-plus"></i>
        </div> -->
        <h3 ng-show='!new_used_car'>二手车入库</h3>
        <!-- 关闭 -->
        <div class="view-header-item color-open above-cover no-widen"
             ng-click='new_used_car = !new_used_car' title="关闭"
             ng-show='new_used_car'>
            <i class="fa fa-close"></i>
        </div>
        <!--<div class="view-header-item color-save above-cover"
             title="保存" ng-click="new_used_car = !new_used_car"
             ng-show="new_used_car">
            <i class="fa fa-save"></i>
        </div> -->
        <!-- 提交 -->
        <div class="view-header-item color-save above-cover" title="提交" ng-show='new_used_car' ng-click="stock_in()">
            <i class="fa fa-check"></i> 确认入库
        </div>
    </div>
</div>
<div class="view-content reception-content">
    <div ag-grid="used_car_grid" class="ag-fresh ag-custom-center" style="height: 100%;"></div>
</div>

<!-- 二手车收购 -->
<div class="data-overlay" ng-show="new_used_car">
	<div class="overlay-container">
		<div class="overlay-header">二手车入库</div>
		<div ng-form name="used_car_add" novalidate="novalidate">
			<div class="overlay-content">
				<div class="overlay-column overlay-column-3">
					<div class="overlay-item">
						<span class="overlay-name">品牌</span>
						<input type="text" name="brand" ng-required="true" ng-model="used_car.brand" disabled="">
					</div>
					<div class="overlay-item">
						<span class="overlay-name">车型</span>
						<input type="text" name="model" ng-required="true" ng-model="used_car.model" disabled="">
					</div>
					<div class="overlay-item">
						<span class="overlay-name">型号</span>
						<input type="text" name="version" ng-required="true" ng-model="used_car.version" disabled="">
					</div>
					<div class="overlay-item">
						<span class="overlay-name">颜色</span>
						<input type="text" name="color" ng-required="true" ng-model="used_car.color" disabled="">
					</div>
					<div class="overlay-item">
						<span class="overlay-name">表征里程</span>
						<input type="text" name="miles" ng-required="true" ng-model="used_car.miles" disabled="">
					</div>
					<div class="overlay-item">
						<span class="overlay-name">初登日期</span>
						<input type="text" name="" disabled="" value="{{used_car.register_date | date:'yyyy-MM-dd'}}">
						<!-- <datetimepicker class="search-date-start"
								ng-required="true"
								name="register_date"
	                        	min-view="2"
	                        	ng-model="used_car.register_date"></datetimepicker> -->
					</div>
					<div class="overlay-item">
						<span class="overlay-name">排量</span>
						<input type="text" name="displacement" ng-required="true" ng-model="used_car.displacement" disabled="">
					</div>
					<div class="overlay-item">
						<span class="overlay-name">变速箱</span>
						<select ng-model="used_car.transmission" ng-required="true" name="transmission" disabled="">
							<option value="MT">手动</option>
							<option value="AT">自动</option>
						</select>
					</div>
					<div class="overlay-item">
						<span class="overlay-name">车架号</span>
						<input type="text" name="" ng-model="used_car.vid" disabled="">
					</div>
					<div class="overlay-item">
						<span class="overlay-name">车况</span>
						<select ng-model="used_car.vehicle_status" ng-required="true" name="vehicle_status" disabled="">
							<option value="0">较差</option>
							<option value="1">一般</option>
							<option value="2">较好</option>
							<option value="3">很好</option>
						</select>
					</div>
				</div>
				<div class="overlay-column overlay-column-3">
					<div class="overlay-item">
						<span class="overlay-name">收购类型</span>
						<select ng-model="used_car.purchase_type" disabled="">
							<option value="0">置换</option>
							<option value="1">收购</option>
							<option value="2">寄售</option>
						</select>
					</div>
					<div class="overlay-item" 
						 ng-show="used_car.purchase_type == 0 || used_car.purchase_type == 1 || used_car.purchase_type == 2">
						<span class="overlay-name">客户来源</span>
						<input type="text" name="" ng-model="used_car.customer_source" disabled="">
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 0">
						<span class="overlay-name">置换门店</span>
						<input type="text" name="" ng-model="used_car.purchase_unit" disabled="">
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 1">
						<span class="overlay-name">收购门店</span>
						<input disabled="" type="text" name="" ng-model="used_car.purchase_unit">
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 0">
						<span class="overlay-name">销售顾问</span>
						<input disabled="" type="text" name="" ng-model="used_car.referral">
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 1 || used_car.purchase_type == 2">
						<span class="overlay-name">推荐人</span>
						<input disabled="" type="text" name="" ng-model="used_car.referral">
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 1 || used_car.purchase_type == 2">
						<span class="overlay-name">推荐人部门</span>
						<select ng-model="used_car.referral_position" disabled>
							<option value="销售">销售</option>
							<option value="售后">售后</option>
							<option value="行政">行政</option>
							<option value="财务">财务</option>
							<option value="客服">客服</option>
							<option value="市场">市场</option>
							<option value="集团">集团</option>
						</select>
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 0 || used_car.purchase_type == 1 || used_car.purchase_type == 2">
						<span class="overlay-name">评估师</span>
						<input disabled="" type="text" name="" ng-model="used_car.appraiser">
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 0 || used_car.purchase_type == 1 || used_car.purchase_type == 2">
						<span class="overlay-name">车主姓名</span>
						<input disabled="" type="text" name="" ng-model="used_car.customer_name">
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 0 || used_car.purchase_type == 1 || used_car.purchase_type == 2">
						<span class="overlay-name">电话</span>
						<input disabled="" type="text" name="phone" ng-model="used_car.phone" >
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 0">
						<span class="overlay-name">置换车型</span>
						<input disabled="" type="text" name="" ng-model="used_car.replacement_vehicle">
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 0">
						<span class="overlay-name">置换日期</span>
						<input type="text" name="" ng-model="used_car.purchase_date" disabled="">
						<!-- <datetimepicker class="search-date-start"
	                        	min-view="2"
	                        	ng-model="used_car.purchase_date"></datetimepicker> -->
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 1">
						<span class="overlay-name">收购日期</span>
						<input type="text" name="" ng-model="used_car.purchase_date" disabled="">
						<!-- <datetimepicker class="search-date-start"
	                        	min-view="2"
	                        	ng-model="used_car.purchase_date"></datetimepicker> -->
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 2">
						<span class="overlay-name">寄售日期</span>
						<input type="text" name="" disabled="" value="{{used_car.purchase_date | date:'yyyy-MM-dd'}}">
						<!-- <datetimepicker class="search-date-start"
										min-view="2"
										ng-model="used_car.purchase_date"></datetimepicker> -->
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 0 || used_car.purchase_type == 1">
						<span class="overlay-name">收购价格</span>
						<input disabled="" type="text" name="" ng-model="used_car.purchase_price">
					</div>
					<div class="overlay-item">
						<span class="overlay-name">过户费用</span>
						<input disabled="" type="text" name="" ng-model="used_car.transfer_fee">
					</div>
					<div class="overlay-item">
						<span class="overlay-name">其它收购成本</span>
						<input disabled="" type="text" name="" ng-model="used_car.extra_fee">
					</div>
					<div class="overlay-item">
						<span class="overlay-name">预期库存风险期</span>
						<input disabled="" type="text" name="" ng-model="used_car.expect_store_risk">
					</div>
					<div class="overlay-item" ng-show="used_car.purchase_type == 0 || used_car.purchase_type == 1 || used_car.purchase_type == 2">
						<span class="overlay-name">备注</span>
						<input disabled="" type="text" name="" ng-model="used_car.remark">
					</div>
					
				</div>
				<div class="overlay-column overlay-column-3 overlay-column-border">
					<div class="overlay-item">
						<span class="overlay-name">仓库号</span>
						<input type="text" name="" ng-model="used_car.warehouse_sn" ng-focus="warehouse_picker = true">
						<div class="warehouse-picker-overlay" ng-show="warehouse_picker" ng-click="warehouse_picker = false"></div>
						<div class="warehouse-picker" ng-show="warehouse_picker">
							<div class="warehouse-picker-content">
								<div class="warehouse-picker-item" ng-repeat="warehouse in warehouses" ng-click="select_warehouse(warehouse,used_car)">{{warehouse.address}}</div>
							</div>
						</div>

					</div>
					<div class="overlay-item">
						<span class="overlay-name">上架销售时间</span>
						<datetimepicker class="search-date-start"
	                        	min-view="2"
	                        	ng-model="used_car.start_sale_time"></datetimepicker>
					</div>
					<div class="overlay-item">
						<span class="overlay-name">整备费用</span>
						<input type="text" name="" ng-model="used_car.reconditioning_cost">
					</div>
					<div class="overlay-item">
						<span class="overlay-name">日常维护费用</span>
						<input type="text" name="" ng-model="used_car.upkeep_cost">
					</div>
					<div class="overlay-item">
						<span class="overlay-name">验车费</span>
						<input type="text" name="" ng-model="used_car.validate_cost">
					</div>
					<div class="overlay-item overlay-item-label">
						<span class="overlay-name">交强险</span>
						<label>
							<input type="checkbox" name="compulsory_insurance_flag"
							ng-false-value="0"
							ng-true-value="1" 
							ng-model="used_car.compulsory_insurance_flag" 
							ng-checked="used_car.compulsory_insurance_flag == 1">
						</label>
                        <datetimepicker class="search-date-start" ng-show="used_car.compulsory_insurance_flag == 1"
	                        	min-view="2"
	                        	ng-model="used_car.compulsory_insurance_expire_date"></datetimepicker>
					</div>
					<div class="overlay-item overlay-item-label">
						<span class="overlay-name">商业险</span>
						<label>
							<input type="checkbox" name="shangyexian"
							ng-false-value="0"
							ng-true-value="1" 
							ng-model="used_car.shangyexian" 
							ng-checked="used_car.shangyexian == 1">
						</label>
					</div>

				</div>
			</div>
		</div>
	</div>
</div>
